<template>
	<view class="w-100">
		<view class="flex-1 row-a-j-fc" style="margin-top: 200rpx;">
			<view class="app-img">
				<image src="https://beichaung.createbei.com/files/common/createbeilove.png" mode=""></image>
			</view>
			<view class="mt-2 font-s-4 font-w">贝创网赚平台</view>
			<view class="mt-3 text-light-muted" @click="saveImage">保存图片</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
		  saveImage() {
		    uni.downloadFile({
		      url: 'https://beichaung.createbei.com/files/common/createbeilove.png', // 替换成你的图片链接
		      success: function(res) {
		        if (res.statusCode === 200) {
		          uni.saveImageToPhotosAlbum({
		            filePath: res.tempFilePath,
		            success: function() {
		              uni.showToast({
		                title: '保存成功',
		                icon: 'success'
		              })
		            },
		            fail: function() {
		              uni.showToast({
		                title: '保存失败，请重试',
		                icon: 'none'
		              })
		            }
		          })
		        }
		      },
		      fail: function() {
		        uni.showToast({
		          title: '图片下载失败，请重试',
		          icon: 'none'
		        })
		      }
		    })
		  }
		}
	}
</script>

<style lang="scss">
	.app-img{
		width: 320rpx;
		height: 320rpx;
		image{
			width: 320rpx;
			height: 320rpx;
		}
	}
</style>